using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Configuration;
using System.Collections;

using IDAL;
using Entities;
namespace Bll
{
    public class AccountBll
    {
        public IList<AccountInfo> GetAll()
        {
            IAccountDAO dal = (IAccountDAO)AssemblyLoader.Load("AccountDAO");
            return dal.GetAll();
        }

        public bool Insert(AccountInfo acc)
        {
            IAccountDAO dal = (IAccountDAO)AssemblyLoader.Load("AccountDAO");
            return dal.Insert(acc);
        }

        public bool Update(AccountInfo acc)
        {
            IAccountDAO dal = (IAccountDAO)AssemblyLoader.Load("AccountDAO");
            return dal.Update(acc);
        }

        public bool UpdateDiscountAndRole(string role, string discount, string username)
        {
            IAccountDAO dal = (IAccountDAO)AssemblyLoader.Load("AccountDAO");
            return dal.UpdateDiscountAndRole(role, discount, username);
        }

        public bool UpdatePassword(AccountInfo acc)
        {
            IAccountDAO dal = (IAccountDAO)AssemblyLoader.Load("AccountDAO");
            return dal.UpdatePassword(acc);
        }

        public bool UpdateDiscount(string discount, string username)
        {
            IAccountDAO dal = (IAccountDAO)AssemblyLoader.Load("AccountDAO");
            return dal.UpdateDiscount(discount, username);
        }

        public AccountInfo GetByUserName(string username)
        {
            IAccountDAO dal = (IAccountDAO)AssemblyLoader.Load("AccountDAO");
            return dal.GetByUserName(username);
        }

        public bool Delete(AccountInfo acc)
        {
            IAccountDAO dal = (IAccountDAO)AssemblyLoader.Load("AccountDAO");
            return dal.Delete(acc);
        }
        public bool CheckExistAccount(string username)
        {
            IAccountDAO dal = (IAccountDAO)AssemblyLoader.Load("AccountDAO");
            return dal.CheckExistAccount(username);
        }
        public ArrayList getRightUsers(string username, string password)
        {
            IAccountDAO dal = (IAccountDAO)AssemblyLoader.Load("AccountDAO");
            return dal.getRightUsers(username, password);
        }
        public string CheckAnswer(string answer)
        {
            IAccountDAO dal = (IAccountDAO)AssemblyLoader.Load("AccountDAO");
            return dal.CheckAnswer(answer);
        }
        public string GetQuestion(string username)
        {
            IAccountDAO dal = (IAccountDAO)AssemblyLoader.Load("AccountDAO");
            return dal.GetQuestion(username);
        }
    }
}
